<?php

/**
 * @copyright 2012
 */
require_once("Category.php");

$name = $_GET["name"];
$id = $_GET["id"];
$imgid = $_GET["imgid"];

//////////////////////////////////////
$category = new Category();
$category->Init($id);
if($name)
{
    $category->name = $name;
}
if($imgid)
{
    $category->imgid = $imgid;
}
$category->Update();
//////////////////////////////////////
  $doc = new DOMDocument();
  $doc->formatOutput = true;
  
  $r = $doc->createElement("categorys");
  $doc->appendChild($r);
  
  $categoryXMLNode = $category->GetXMLNode($doc);
  $r->appendChild($categoryXMLNode);
  
  echo $doc->saveXML();

?>